Technical Q&A QA1263
HTTPS Proxy Settings and Java Applets


Q: How do I set the https proxy for applets running in the Java Plug-in?

A: As of Java 1.4.2 on Mac OS X Panther, Java applications and applets now use HTTPS proxy settings from System Preferences. Earlier versions of Java did not use this information, but it is still possible to specify it if necessary by following the instructions below.

You can override the Java Plugin default startup parameters for Java Applets by specifying custom options in the Java Runtime Parameters field. Setting the Java Runtime Parameters "https.proxyHost" and "https.proxyPort" to the secure proxy's host name and port in the appropriate Java Plugin Settings application will set the secure proxy for applets. The syntax is the same as used with parameters to the java command line invocation. See the Java 2 Standard Edition (J2SE) documentation for a full list of command line options.

The Java Plugin Settings applications are located in the folder /Applications/Utilities/Java on a Mac OS X system.

The Advanced tab of the "Java 1.4.1 Plugin Settings" application has the Java Runtime Parameters text field for applets running in Java 1.4.1.

The Basic tab of the "Java 1.3.1 Plugin Settings" application has the Java Runtime Parameters text field for applets running in Java 1.3.1.

The listing below demonstrates the Java Runtime Parameters for a secure proxy server host named "secureproxy.company.com" using port 443.



Listing 1. Example Runtime Parameters for the Java Plugin Settings application.


-Dhttps.proxyHost=secureproxy.company.com -Dhttps.proxyPort=443





[Feb 26, 2004]


Developer Documentation | Technical Notes | Development Kits | Sample Code